#!/bin/bash
currDir=$(cd "$(dirname "$0")"; pwd)
proPath="${currDir}"

if [ $1_ == "_" -a $2_ == "_" ]
then
    echo "Usage: sh install.sh clean      清除当前环境中的配置及中间文件"
    echo "       sh install.sh prd        安装线上环境"
    echo "       sh install.sh test       安装线上测试环境"
    echo "       sh install.sh dev        安装开发环境"
    echo "       sh install.sh staging    预发布环境"
    exit 1
fi
if [ $1_ == "test_" ]
then

    cp -R "${proPath}/conf/test/test.conf" "${proPath}/conf/app.conf"

elif [ $1_ == "prd_" ]
then

    cp -R "${proPath}/conf/prd/prd.conf" "${proPath}/conf/app.conf"

elif [ $1_ == "dev_" ]
then

    cp -R "${proPath}/conf/dev/dev.conf" "${proPath}/conf/app.conf"

elif [ $1_ == "clean_" ]
then
    rm -f "${proPath}/conf/app.conf"

elif [ "" == "" ]
then
    echo "警告: 参数1非法"
    exit 1
fi
